<%@ page contentType="text/html;charset=UTF-8" language="java"%>
<%@ page import="java.util.Enumeration,java.util.Objects" %>
<!DOCTYPE html>
<html>
<head>
<title>转发器2结果</title>
</head>
<body>
  此页面为servlet2的目标转发页面<br>
  该转发器由ServletContext.getRequestDispatcher(java.lang.String)生成<br>
  <%
      out.print("获取request参数<br>");
      Enumeration<String> names = request.getParameterNames();
      while (names.hasMoreElements()) {
          String element = names.nextElement();
          String val = request.getParameter(element);
          if (Objects.nonNull(val)) {
              out.print(element + "：" + val + "<br>");
          }
      }
      names = request.getAttributeNames();
      out.print("获取request的属性<br>");
      while (names.hasMoreElements()) {
          String element = names.nextElement();
          Object val = request.getAttribute(element);
          if (Objects.nonNull(val)) {
              out.print(element + "：" + val + "<br>");
          }
      }
  %>
</body>
</html>
